package gui.menu;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import xmlrpc.gui.ServerMainFrameController;



/**
 * Class for listening on and controlling the PanelMenuView
 * @author Qw4z1
 *
 */
public class PanelMenuController implements ActionListener{
	@Override
	public void actionPerformed(ActionEvent e) {
		//exit app
		if(e.getSource().equals(PanelMenuView.getInstance().exitButton))
			System.exit(0);
		//start server
		else if (e.getSource().equals(PanelMenuView.getInstance().startServerButton))
			ServerMainFrameController.getInstance().startServer();
		//connect to server
		else if (e.getSource().equals(PanelMenuView.getInstance().connectToServerButton))
			new ConnectionDialog(null).setVisible(true);
	} 
	

}
